<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:replace="layouts::header"></head>
<body>
<nav th:replace="layouts::header"></nav>
<div class="container">
  <h3>学生列表</h3>
  <hr>

  <a th:href="@{/students/new}" class="bin btn-primary btn-sm mb-3">新增学生</a>
  <br>
  <table class="table table-bordered table-striped">
    <thead class="thead-dark">
    <tr>
      <th>学生姓名</th>
      <th>微信号</th>
      <th>邮箱</th>
      <th>ID</th>
      <th>动作</th>
    </tr>
    </thead>
    <tbody>
    <tr th:each="aStudent : ${students}"}>
      <td th:text="${aStudent.name}"></td>
      <td th:text="${aStudent.wechat}"></td>
      <td th:text="${aStudent.email}"></td>
      <td th:text="${aStudent.ID}"></td>
      <td>
        <a th:href="@{students/update(id=${aStudent.studentId})}" class="btn btn-info btn-sn">更新</a>
        <a
                th:href="@{students/detele(id=${aStudent.studentId})}"
                class="btn btn-info btn-sn"
                onclick="if (!(confirm('你确定删除这个学生吗？'))) return false "
                >删除</a>
      </td>
    </tr>
    </tbody>
  </table>


</div>

</body>
</html>